import request from '@/utils/request'

// 列表
export function getDataList(query) {
  return request({
    url: '/car/carWorkOrder/list',
    method: 'get',
    params: query
  })
}

//车辆归属 车辆产权
export function listDept(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}

//新增 车架号
export function getVinNo(vinNo) {
  return request({
    url: `/car/carBasic/findCarBasicByVinNo/${vinNo}`,
    method: 'get',
  })
}

//根据车辆id查询正在用车中的车辆订单信息
export function findCarOrderVoByCarId(vinNo) {
  return request({
    url: `/car/carWorkOrder/findCarOrderVoByCarId/${vinNo}`,
    method: 'get',
  })
}

// 新增工单信息
export function submitCarWorkOrder(data) {
  return request({
    url: '/car/carWorkOrder',
    method: 'post',
    data
  })
}


//处理详情
export function getFindCarWorkOrderInfoVo(id) {
  return request({
    url: '/car/carWorkOrder/findCarWorkOrderInfoVo/' + id,
    method: 'get'
  })
}


// 查询详情 保养
export function getMaintain(id) {
  return request({
    url: '/car/carMaintain/' + id,
    method: 'get'
  })
}

// 新增

export function addMaintain(data) {
  return request({
    url: '/car/carMaintain/save',
    method: 'post',
    data: data
  })
}

// 获取供应商列表
export function getInsuranceSelectList(params) {
  return request({
    url: '/supplier/supplier/allList',
    method: 'get',
    params: params
  })
}


export function getList() {
  return request({
    url: '/system/depreciationConfig/list',
    method: 'get',
  })
}

//根据车牌号查
export function getCarNo(carNo) {
  return request({
    url: `/car/carBasic/findCarBasicByCarNo/${carNo}`,
    method: 'get',
  })
}

export function findCarListByCarNo(carNo) {
  return request({
    url: `/car/carBasic/findCarListByCarNo/${carNo}`,
    method: 'get',
  })
}
